package com.kx.yooli.kx.wechat.constant;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashSet;
import java.util.Set;

/**
 * @author john_sqwen-childe.wen
 * @date 2024/4/2
 * @PROJECT_NAME wechat
 * @description create QhxgConstants by john_sqwen
 * and QhxgConstants value is
 */
public class QhxgConstants {
    private final Logger log = LoggerFactory.getLogger(QhxgConstants.class);
    /**
     * 移动渠道代码
     */
    public static final String CHL_MOB = "001";
    /**
     * 一般渠道代码
     */
    public static final String CHL_NOR = "002";
    /**
     * 是否-是
     */
    public static final String YES = "000001";
    /**
     * 是否-否
     */
    public static final String NO = "000002";

    /**
     * 移动产品首付类型-高首付
     */
    public static final String DOWN_PAY_TYPE_HIGH = "015001";
    /**
     * 移动产品首付类型-低首付
     */
    public static final String DOWN_PAY_TYPE_LOW = "015002";

    /**
     * 一般平台
     */
    public static final String LOAN_TYPE_PT = "020001";

    /**
     * 移动
     */
    public static final String LOAN_TYPE_YD = "020002";

    /**
     * 派单渠道
     */
    public static final String DISPATCHCHANNEL_01 = "02800001";// 请选择
    public static final String DISPATCHCHANNEL_02 = "02800002";// 外呼派单
    public static final String DISPATCHCHANNEL_03 = "02800003";// 微信申请
    public static final String DISPATCHCHANNEL_04 = "02800004";// 客服电话
    public static final String DISPATCHCHANNEL_05 = "02800005";// APP
    public static final String DISPATCHCHANNEL_06 = "02800006";// 其他

    public static final String LOAN_APP_NEED_AUDIT = "013000";//合同待审核
    public static final String LOAN_APP_OK = "013001";//通过
    public static final String LOAN_APP_PASS = "013002";//不通过
    public static final String LOAN_APP_MODI  = "013003";//返回修改
    public static final String LOAN_APP_REVOKE = "013004";//已撤销
    public static final String LOAN_APP_REGISTER = "013005";//已注册
    public static final String LOAN_APP_CANEL = "013006";//取消
    //合同接口状态
    public static final String LOAN_NOTICE_ABANDON = "013007"; // 消息同步-合同废止
    public static final String LOAN_NOTICE_NO_RELEASE = "013008"; // 消息同步-未放款
    public static final String LOAN_NOTICE_APPLYING = "013009"; // 消息同步-放款申请中
    public static final String LOAN_NOTICE_REPAYING = "013010"; // 消息同步-还款中
    public static final String LOAN_NOTICE_OVERDUE = "013011"; // 消息同步-逾期
    public static final String LOAN_NOTICE_CASE = "013012"; // 消息同步-案件
    public static final String LOAN_NOTICE_FINISHED = "013013"; // 消息同步-结清

    public static final String LOAN_LOCAL_SALER_PASS = "013101";//审核通过，销售通过
    public static final String LOAN_LOCAL_USER_MODIFYED= "013014";//客户已提交
    public static final String LOAN_LOCAL_APPLY_NEED_SIGN = "013015";//进件待签约
    public static final String LOAN_LOCAL_MODIFY_NEED_SIGN = "013115";//返修待签约
    public static final String LOAN_LOCAL_APPLY_SIGNED = "013016";//进件已签约
    public static final String LOAN_LOCAL_MODIFY_SIGNED = "013116";//返修已签约

    public static Set<String> REGISTED_LOAN_STATUS = new HashSet<String>();
    static {
        REGISTED_LOAN_STATUS.add(LOAN_APP_REGISTER);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_ABANDON);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_NO_RELEASE);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_APPLYING);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_REPAYING);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_OVERDUE);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_CASE);
        REGISTED_LOAN_STATUS.add(LOAN_NOTICE_FINISHED);
    }
    /**
     * 合同不能修改的状态
     */
    public static Set<String> CANNOT_MODIFY_LOAN_STATUS = new HashSet<String>();
    static{
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_LOCAL_USER_MODIFYED);
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_LOCAL_APPLY_NEED_SIGN);
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_LOCAL_APPLY_SIGNED);
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_LOCAL_MODIFY_NEED_SIGN);
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_LOCAL_MODIFY_SIGNED);
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_APP_NEED_AUDIT);
        CANNOT_MODIFY_LOAN_STATUS.add(LOAN_APP_OK);
    }
    /**
     * 待签约的借款合同（只是针对兜享花首页状态用）
     */
    public static Set<String> NEED_SIGN_LOAN = new HashSet<String>();
    static {
        NEED_SIGN_LOAN.add(LOAN_LOCAL_APPLY_NEED_SIGN);
    }
    /**
     *  返回修改（只是针对兜享花首页状态用）
     */
    public static Set<String> AUDITMODI_LOAN_STATUS = new HashSet<String>();
    static{
        AUDITMODI_LOAN_STATUS.add(LOAN_APP_MODI);
    }
    /**
     * 审核中（只是针对兜享花首页状态用）
     */
    public static Set<String> AUDITING_LOAN_STATUS = new HashSet<String>();
    static{
        AUDITING_LOAN_STATUS.add(LOAN_APP_NEED_AUDIT);
        AUDITING_LOAN_STATUS.add(LOAN_LOCAL_APPLY_SIGNED);
        AUDITING_LOAN_STATUS.add(LOAN_LOCAL_MODIFY_SIGNED);
        AUDITING_LOAN_STATUS.add(LOAN_APP_NEED_AUDIT);
    }
    /**
     * 审核通过（只是针对兜享花首页状态用）
     */
    public static Set<String> AUDITPASS_LOAN_STATUS = new HashSet<String>();
    static{
        AUDITPASS_LOAN_STATUS.add(LOAN_APP_OK);
        AUDITPASS_LOAN_STATUS.add(LOAN_APP_REGISTER);
    }
    /**
     * 审核不通过（只是针对兜享花首页状态用）
     */
    public static Set<String> LOAN_APP_NOT_PASS = new HashSet<String>();
    static{
        LOAN_APP_NOT_PASS.add(LOAN_APP_PASS);
        LOAN_APP_NOT_PASS.add(LOAN_APP_REVOKE);
        LOAN_APP_NOT_PASS.add(LOAN_APP_CANEL);
    }
    /**
     * 申请状态
     */
    public static final String APPLY_STATUS_NEW = "050001";// 登记
    public static final String APPLY_STATUS_DELWITH = "050002";// 审批中
    public static final String APPLY_STATUS_PASS = "050003";// 审批通过
    public static final String APPLY_STATUS_NOPASS = "050004";// 审批不通过

    public static final String CUST_TYPE_PER = "017001";// 个人
    public static final String CUST_TYPE_STU = "017002";// 学生

    public static final String PLAN_REPAY_TYPE_PRE = "028001";// 提前还款
    public static final String PLAN_REPAY_TYPE_OVER = "028002";// 提前结清
    public static final String REPAY_TYPE_NOM = "028003";// 正常还款
    public static final String REPAY_TYPE_FAIL = "028004";// 失败重扣
    public static final String REPAY_TYPE_DUE = "028005";// 催收扣款
    public static final String REPAY_TYPE_DUE_PRE = "028006";// 催收提前还款
    public static final String REPAY_TYPE_DUE_OVER = "028007";// 催收提前结清
    public static final String REPAY_TYPE_DUE_ENTURST = "028008";// 委外崔搜

    public static final String PLAN_REPAY_CHL_HK = "029001";// 对公汇款
    public static final String PLAN_REPAY_CHL_DK = "029002";// 银联代扣
    public static final String PLAN_REPAY_CHL_DK_ONE = "029003";// 银联单笔单批代扣

    public static final String PLAN_REPAY_ST_NOTY = "035001";// 未还款
    public static final String PLAN_REPAY_ST_SUCC = "035002";// 还款成功
    public static final String PLAN_REPAY_ST_FAIL = "035003";// 还款失败
    public static final String PLAN_REPAY_CANEL = "035004";// 取消
    public static final String PLAN_REPAY_ST_DG = "035005";// 已对公

    public static final String REPAY_ST_FAIL = "036001";// 还款失败
    public static final String REPAY_ST_SUCC = "036002";// 还款成功
    public static final String REPAY_ST_DUB = "036003";// 重复还款

    public static final String IS_CLEAR_YES = "037001";// 已结清
    public static final String IS_CLEART_NO = "037002";// 未结清
    public static final String IS_CLEAR_OVER = "037003";// 超额

    public static final String DK_RES_FIELD = "0";// 银联代扣状态-失败
    public static final String DK_RES_SUCC = "1";// 银联代扣状态-成功
    public static final String DK_RES_FIELD_YL = "2";// 银联代扣状态-失败-和银联匹配

    // by hwen 2013 9 24
    // 银联状态
    public static final String TRAN_ST_FIELD = "3008";// 余额不足
    public static final String TRAN_ST_SUCC = "0000";// 交易成功
    public static final String TRAN_ST_REJECT = "2002";// 代扣审核拒绝

    public static final String NEW_TRAN_ST_FIELD = "51";// 余额不足
    public static final String NEW_TRAN_ST_SUCC = "1001";// 交易成功
    public static final String NEW_TRAN_ST_CODE_SUCC = "00";// 交易成功

    // 返回关联方
    public static final String RETURN_PARTY_PER = "031001";// 客户原因
    public static final String RETURN_PARTY_COM = "031002";// 我方原因

    // 证件类型
    public static final String RETURN_CERT_TYPE = "0";// 银联返回证件类型
    public static final String CERT_TYPE_NO = "001001"; // 二代身份证
    public static final String CERT_TYPE_TEMP = "001002";// 临时身份证

    // 决策原因TYPE
    public static final String PASS_DEC_CODE = "passDecisionCode";// 通过
    public static final String REJECT_DEC_CODE = "rejectDecisionCode"; // 不通过
    public static final String CANCEL_DEC_CODE = "cancelDecisionCode";// 取消
    // end

    // 对公还状态
    public static final String REPAY_DG_STATUS_CANCEL = "038001";// 取消
    public static final String REPAY_DG_STATUS_UNPAY = "038002"; // 未还
    public static final String REPAY_DG_STATUS_PAIED = "038003";// 已还
    public static final String REPAY_DG_STATUS_FAIL = "038004";// 失败
    public static final String REPAY_DG_STATUS_EXPORT = "038005";// 已导出
    public static final String REPAY_DG_STATUS_HANDLING = "038006";// 处理中
    // end

    // 财务入账状态
    public static final String INCOME_STATUS_INCOME = "039001";// 已入账
    public static final String INCOME_STATUS_UNINCOME = "039002"; // 未入账
    public static final String INCOME_STATUS_INCOMING = "039003";// 处理中
    // end

    // 失败处理状态
    public static final String FAIL_DEAL_ST_SUCC = "040001";// 成功
    public static final String FAIL_DEAL_ST_FAIL = "040002"; // 失败
    public static final String FAIL_DEAL_ST_NOTYET = "040003";// 未处理
    public static final String FAIL_DEAL_ST_DEAL = "040004";// 处理中
    public static final String FAIL_DEAL_ST_OVERDUE = "040005";// 导入催收
    // end

    // 还款失败处理结果
    public static final String DEAL_RESULT_PAIED = "041001";// 客户已还款
    public static final String DEAL_RESULT_UNPAIED = "041002"; // 客户未还款
    // end

    // 代扣文件起始编号
    public static final String FILE_DK_START_CODE = "9";// 失败代扣起始编号
    public static final String DULE_DK_START_CODE = "8"; // 催收代扣起始编号
    public static final String EN_DK_START_CODE = "7"; // 委外对公起始编号
    public static final String DULE_DK_START_CODE_ONE = "6"; // 银联单笔单批
    // end

    // 代扣结算状态
    public static final String CONFIRM_TYPE_OPEN = "044001";// 已启动
    public static final String CONFIRM_TYPE_CLOSE = "044002";// 未启动
    public static final String CONFIRM_TYPE_CON = "044003";// 已结算
    // end

    // 案件分配状态
    public static final String DIS_STATUS_NO = "046001";// 未分配
    public static final String DIS_STATUS_GROUP = "046002";// 分配到组
    public static final String DIS_STATUS_LEDER = "046003";// 分配到组员
    public static final String DIS_STATUS_ENEXP = "046004";// 已委外

    // 系统允许运营处理失败的最长天数，这个天数要和产生滞纳金的天数一致
    public static final int DEAL_LIMIT_DATE = 10;

    // 黑名单状态
    public static final String B_LIST_STATUS_OPEN = "055001";
    public static final String B_LIST_STATUS_ATTENTION = "055002";
    public static final String B_LIST_STATUS_CLOSE = "055003";

    public static final String B_LIST_TYPE_FOR_OVERDUE = "056001";
    public static final String B_LIST_TYPE_FOR_EXCEL = "056002";
    public static final String B_LIST_TYPE_FOR_APPLY = "056003";
    public static final String B_LIST_TYPE_FOR_APPVO = "056004";// 审核

    public static final String B_STAFF_ROLE = "2CC9B01DFFA8014F011CB5D677BBCEFA";

    public static final String CON_INCOME_I = "057001";
    public static final String CON_INCOME_O = "057002";

    // 保险状态
    public static final String INS_STATUS_UNEXP = "058001";// 保险未导出
    public static final String INS_STATUS_EXP = "058002";// 保险已导出
    public static final String INS_STATUS_UNSUCC = "058003";// 承保失败

    // 委外状态
    public static final String EN_STATUS_UNEXP = "059002";// 未委外
    public static final String EN_STATUS_EXP = "059001";// 已委外
    // 委外执行状态
    public static final String EN_DK = "060005";// 已代扣
    public static final String EN_DG = "060004";// 已对公
    public static final String EN_STATUS_OVER = "060003"; // 已撤销
    public static final String EN_STATUS_UNSUCC = "060002"; // 未完成
    public static final String EN_STATUS_SUCC = "060001"; // 已完成

    public static final int REGRET = 5; // 贷款后悔期(天)

    public static final int INS_DATE = 30;// 保险保期
    // 客户保险费率
    public static final double INS_FEE_CUST_RATE = 0.007;
    // 保险公司保费率
    public static final double INS_FEE_COM_RATE = 0.0006;

    public static final String STATE_YES = "1";// 正常
    public static final String STATE_NO = "0";// 禁用

    public static final int MAX_EXP_DT = 200000;// 最大导出条数
    public static final int MAX_EXP = 10000;// 最大导出条数
    public static final int MAX_EXP_PAGESIZE = 10000;// 单次查询最大条数

    public static final int TRANSAMT_PROPORTION = 100;// 银联代扣 单位/元

    public static final String SOCIAL_SECURITY = "018004";// 码表doc_type 社保代码
    public static final String DRIVING_LICENSE = "018003";// 码表doc_type 驾照代码
    public static final String ELSE_DOC = "018006";// 码表doc_type 其他代码

    public static final String OPERATION_DISPATCH = "operation_dispatch";// 调度平台
    public static final String OPERATION_MANUAL = "operation_manual";// 手工操作

    public static final String EXPORT = "export";// 导出操作

    public static final String SALES_COUNT = "sales_count";// 销售统计
    public static final String AREA_COUNT = "area_count";// 区域统计

    /**
     * 推送内容
     */
    public static final String WECHATPUSHTYPE_BEFOREAPPLY = "201602001";// 推送意向客户信息
    public static final String WECHATPUSHTYPE_AFTERAPPLY = "201602002";// 推送申请编号
    /**
     * 微信派单状态
     */
    public static final String WECHATDISPATCHTYPE_FINISH = "201605001";// 派单完成
    public static final String WECHATDISPATCHTYPE_FAIL = "201605002";// 派单失败
    public static final String WECHATDISPATCHTYPE_SALERGET = "201605003";// 销售已抢单
    public static final String WECHATDISPATCHTYPE_OUTTIME = "201605004";// 失效
    public static final String WECHATDISPATCHTYPE_SALERRESPONSE = "201605005";// 销售已反馈
    public static final String WECHATDISPATCHTYPE_NO_SA = "201605006";// 未匹配到SA
    public static final String WECHATDISPATCHTYPE_NO_SA_END = "201605007";// 未匹配到SA到失效
    public static final String WECHATDISPATCHTYPE_FAIL_CONDITION = "201605008";// 条件不符
    public static final String WECHATDISPATCHTYPE_FAIL_REPEAT = "201605009";// 派单重复

    /**
     * 沟通结果
     */
    public static final String COMMUNICATRESULTTYPE_TOONLINE = "201604001";// 线上办理
    public static final String COMMUNICATRESULTTYPE_OVER = "201604002";// 结束沟通
    public static final String COMMUNICATRESULTTYPE_GO_ON = "201604003";// 继续跟进

    /**
     * 客户意向
     */
    public static final String customerIntentionType_yes = "201603001";// 意向办理
    public static final String customerIntentionType_no = "201603002";// 无意向
    public static final String customerIntentionType_unknown = "201603003";// 意向不明确

    /**
     * 是否是促销
     */
    public static final String isProm_yes = "1";
    public static final String isProm_no = "0";

    /**
     * 渠道来源
     */
    public static final String chanSource_sale = "sale";
    public static final String chanSource_wechat = "wechat";
    public static final String chanSource_app = "app";
    /**
     * 渠道
     */
    public static final String chanCode_pos = "002";
    public static final String chanCode_credit = "001";
    /**
     * 产品类型, T001 常规产品, T002 小额产品,T003小额外部A产品; R001K易贷A,R002K易贷B;T004 低息现金贷
     */
    public static final String PROD_TYPE_NORMAL = "T001";
    public static final String PROD_TYPE_SMALL = "T002";
    public static final String PROD_TYPE_SMALL_EXPORT_A = "T003";
    public static final String PROD_TYPE_RESERVATION_A = "R001";
    public static final String PROD_TYPE_RESERVATION_B = "R002";
    public static final String PROD_TYPE_DXD = "D001";
    public static final String PROD_TYPE_MERLOAN = "K001";
    public static final String PROD_TYPE_LOW_RATE = "T004";

    /**
     * 合同类型： D001兜享贷进件 、 T001交叉现金贷自主进件（快信app，公众号） T002小额产品现金贷（快信app，公众号） T003：小额外部A产品现金贷（快信app，公众号）
     * R001：针对K易贷A产品（公众号，企业号）;R002:针对K易贷B产品
     * F001：交叉现金贷辅助进件（sale，公众号，企业号） P001：pos贷进件（快信app，sale，公众号，企业号）  K002 PC端商户贷
     */
    public static final String LOCAL_LOAN_TYPE_DXD = "D001";
    public static final String LOCAL_LOAN_TYPE_NORMAL = "T001";
    public static final String LOCAL_LOAN_SMALL = "T002";
    public static final String LOCAL_LOAN_SMALL_EXPORT_A = "T003";
    public static final String LOCAL_LOAN_RESERVATION_A = "R001";
    public static final String LOCAL_LOAN_RESERVATION_B = "R002";
    public static final String LOCAL_LOAN_TYPE_CASH_FZ = "F001";
    public static final String LOCAL_LOAN_TYPE_POS_FZ = "P001";
    public static final String LOCAL_LOAN_TYPE_HUABEI = "P002";
    public static final String LOCAL_LOAN_TYPE_RONG360 = "D002";
    public static final String LOCAL_LOAN_TYPE_MERLOAN = "K001";
    public static final String LOCAL_LOAN_TYPE_MERLOAN_PC = "K002";
    public static final String LOCAL_LOAN_LOW_RATE = "T004";
    public static final String LOCAL_LOAN_TYPE_CASH_FZ_LOW_RATE = "F002";
    public static final String LOCAL_LOAN_TYPE_YM = "P003"; //柠檬医美
    public static final String LOCAL_LOAN_TYPE_JY = "P004"; //柠檬教育

    // 交叉现金贷
    public static Set<String> LOCAL_LOAN_TYPE_CASH_CROSS = new HashSet<String>();
    static {
        LOCAL_LOAN_TYPE_CASH_CROSS.add(LOCAL_LOAN_TYPE_NORMAL);
        LOCAL_LOAN_TYPE_CASH_CROSS.add(LOCAL_LOAN_SMALL);
        LOCAL_LOAN_TYPE_CASH_CROSS.add(LOCAL_LOAN_SMALL_EXPORT_A);
        LOCAL_LOAN_TYPE_CASH_CROSS.add(LOCAL_LOAN_LOW_RATE);
    }
    /**
     * session中的产品类型的键
     */
    public static final String SESSION_PROD_TYPE = "PRODTYPE";

    public static final String DXD_PROFILE_CUST_INFO="DXD_PROFILE_CUST_INFO";//兜想贷客户基本信息验证
    public static final String DXD_PROFILE_BANK_INFO="DXD_PROFILE_BANK_INFO";//兜想贷客户银行卡信息验证

    /**
     * JBXX-基本信息   SJ-手机认证   YHK-银行卡认证   RLSB-人脸识别认证 ZHIMA-芝麻信用
     */
    public static final String DXD_VALIDATE_JBXX="JBXX";
    public static final String DXD_VALIDATE_SJ="SJ";
    public static final String DXD_VALIDATE_YHK="YHK";
    public static final String DXD_VALIDATE_RLSB="RLSB";
    public final static String ZHIMA_BUSI_KEY = "ZHIMA";


    /**
     * kafka topic 常量
     */

    public static final String KAFKA_TOPIC_REPAY_NOTICE="repayNotice";//还款逾期通知topic
    public static final String KAFKA_TOPIC_LOAN_AUDIT_STATUS_CHANGE="loanAuditStatusChange";//贷中合同状态推送topic
    public static final String KAFKA_TOPIC_KX_LOAN_AUDIT_STATUS_CHANGE="kxLoanAuditStatusChange";//SA通过拒绝状态推送topic
    public static final String KAFKA_TOPIC_LOAN_STATUS_CHANGE="loanStatusChange";//贷后合同状态推送topic  柠檬融360使用topic
    public static final String KAFKA_TOPIC_DXD_NOTICE="douxiangdaiNotice";//贷后放款成功还款成功状态推送topic
    public static final String KAFKA_TOPIC_CONTRACT_UPLOAD_SUCC="contractUploadSucc";//合同上传成功通知topic
    public static final String KAFKA_TOPIC_AFTER_LOAN_SIGN_SUCCESS="afterLoanSignSuccess";//合同签署成功通知topic
    public static final String KAFKA_TOPIC_OVERDUE_NOTICE="overdueNotice";//逾期提醒通知topic
    public static final String KAFKA_TOPIC_REPAY_SUCCESS="repaySuccess";//还款成功提醒通知topic
    public static final String KAFKA_TOPIC_REPAY_FAIL="repayFail";//还款失败提醒通知topic

    //public static final String ROCKET_TOPIC_OVERDUE=CustomizedPropertyConfigurer.getContextProperty("rocketmq.topic").toString();//催收的rocketmq消息


    public static final String REDIS_KEY_KAFKA_MESSAGE = "kx_wechat:redis:key:kafka:message";//kafa消息rediskey
    public static final String REDIS_KEY_KAFKA_MESSAGE_REPAY_NOTICE = "kx_wechat:redis:key:kafka:message:repay:notice";//kafa消息rediskey
    public static final String REDIS_KEY_KAFKA_MESSAGE_REPAY_NOTICE_FAIL = "kx_wechat:redis:key:kafka:message:repay:notice:fail";//kafa消息rediskey
    public static final String REDIS_KEY_GYSD_OVERDUE_MESSAGE_KEY = "kx_wechat:redis:key:gysd:overdue:message";
    public static final String REDIS_KEY_KAFKA_MESSAGE_REPAY = "kx_wechat:redis:key:kafka:repay:message";
}
